import time

from hello._08闭包 import li2


def calculate_time(func):
    def inner(*args, **kwargs):
        start_time = time.time()
        ret = func(*args, **kwargs)
        end_time = time.time()
        print(end_time - start_time)
        return ret

    return inner


@calculate_time
def print1to20():
    for i in range(1, 21):
        time.sleep(0.2)
        print(i, end=" ")
    else:
        print()


# print1to20 = calculate_time(print1to20)
print(print1to20())
